import type { RouteRecordRaw } from 'vue-router'

import { createRouter, createWebHistory } from 'vue-router'

const routes: readonly RouteRecordRaw[] = [
  {
    path: '/yc',
    redirect: '/eo/yc/list'
  },
  {
    path: '/ws',
    redirect: '/eo/ws/list'
  },
  {
    path: '/',
    redirect: '/eo'
  },
  {
    name: 'home',
    path: '/home',
    component: () => import('@/views/PageHome.vue')
  },
  {
    name: 'dev',
    path: '/dev',
    component: () => import('@/views/PageDev.vue')
  },
  {
    name: 'Eolink',
    path: '/eo',
    redirect: '/eo/list',
    children: [
      {
        name: 'PageWsEolinkList',
        path: '/eo/ws/list',
        props: {
          platform: 'ws'
        },
        component: () => import('@/views/eolink/list.vue')
      },
      {
        name: 'PageYcEolinkList',
        path: '/eo/yc/list',
        props: {
          platform: 'yc'
        },
        component: () => import('@/views/eolink/list.vue')
      },
      {
        name: 'PageEolinkList',
        path: '/eo/list',
        component: () => import('@/views/eolink/list.vue')
      },
      {
        name: 'PageEolinkCfg',
        path: '/eo/cfg',
        component: () => import('@/views/eolink/cfg.vue')
      },
      {
        name: 'PageEolinkExp',
        path: '/eo/exp',
        component: () => import('@/views/eolink/exp.vue')
      }
    ]
  }
]

export default createRouter({
  history: createWebHistory(),
  routes
})

